<html>
<head>
  <title>服务区域</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <link href="static/mobiscroll.min.css" rel="stylesheet">
    <style>
        .dialog-head {
            position: fixed;
            z-index: 999999;
            top: 0px;
        }
        .dialog-main {
            top: 50px;
        }
        .dialog-head > div:first-child {
            font-size: 16px !important;
        }
        button[name=subdqbtn] {
            padding: 7px 10px;
            background-color: #F4F4F9;
            color: #1d1d1d;
            font-size: 15px;
            margin-right: 10px;
            margin-bottom: 14px;
            height: 22px;
            border-radius: 3px;
            font-weight: 600;
            width: 71px;
        }
        .jy_yhxy {
            margin-bottom: 20px;
            display: table;
            position: fixed;
            z-index: 2000;
            left: 0px;
            right: 0px;
            bottom: 0px;
            width: 100%;
            text-align: center;
        }
       .dialog-main .btn.active {
		    background-color: #24C0D7;
		    color: #FFFFFF;
		}

        .dialog-main #dqbtn.active {
            background-color: #24C0D7;
            color: #FFFFFF;
        }
    </style>
    <link href="static/bootstrap.min.css" rel="stylesheet">
    <link href="static/weixinstyle.css?v=1602" rel="stylesheet"> 
    <link href="static/bootswatch.min.css" rel="stylesheet">
	<link href="static/font.css" rel="stylesheet">
	<link href="static/jy.css" rel="stylesheet">
	<link href="static/common.css" rel="stylesheet">
	<link href="static/animate.css" rel="stylesheet">
	<link rel="stylesheet" href="static/unicorn.main.css">
	<link rel="stylesheet" href="static/unicorn.grey.css">
<body>
<div class="dialog-head">
    <div>服务区域</div>
     <div style="display:none"><span class="submit" id="spansubmit">确定</span></div>
</div>

<script src="static/sousuo/files1/jquery.js"></script>
<script src="static/sousuo/files1/jquery.cookie.js"></script>
<script src="static/sousuo/files1/bootstrap.min.js"></script>
<script src="static/sousuo/files1/jy.js"></script>
<script src="static/sousuo/files1/common.js"></script>
<script type="text/javascript" src="static/sousuo/files1/jweixin-1.0.0.js"></script>
<script src="static/sousuo/files1/jquery.js"></script>
<script src="static/sousuo/files1/mobiscroll.min.js"></script>
<script src="static/sousuo/files1/share.js"></script>
<script src="static/sousuo/files1/search.js"></script>
<script src="static/sousuo/files1/jquery.resize.js"></script>
<script>
	var isIOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); 
	var scrollTop = 0;
	var lifirst = true;
	var lipost = "T"
	var clientH = 0;
	var msgset= ["Visual","卡巴斯基","Studio","编程语言","加密狗","SDK"];
		$(function(){
		setTimeout(function(){
			$(window).scrollTop(0);
			$(window).scroll(function(){
				scrollTop = $(this).scrollTop();
			});
		},0);
		
		var initSearchPage = function(){
			$("#searchDiv").show();
			$(".medium").hide();
			$("#searchlist").addClass("hide");
			$(".resbm").addClass("hidden");
		}
		
		clientH = document.body.clientHeight;
		$(".medium").click(function(){
			$(".resbm").addClass("hidden");
			$("#searchlist").addClass("hide");
			$(".sl-jyshxbottom").addClass("hide");
			$("#searchDiv").show();
			setTimeout(function(){

				$(".searchname").removeClass("inputHide");
			},500);
			$(".searchname").focus();
			var snqc = $(".searchname").val();
			if(snqc.length > 0){
				$(".qc").removeClass("hidden");
			}else{
				$(".qc").addClass("hidden");
			}
			initMobiscroll();
			
			$(".jypt-dialog .jypt-active").removeClass("jypt-active");
			$(".jypt-dialog .jypt-timeinputs-active").removeClass("jypt-timeinputs-active");
			var jptyActiveObj = $("#searchlist").contents().find(".jypt-dialog .jypt-active");
			if(jptyActiveObj.length > 0){
				$(".jypt-dialog .jypt-pt button").each(function(){
					if($(this).text() == jptyActiveObj.text()){
						$(this).addClass("jypt-active");
						return true;
					}
				});
			}else{
				jptyActiveObj = $("#searchlist").contents().find(".jypt-dialog .jypt-timeinputs-active");
				if(jptyActiveObj.length > 0){
					$(".jypt-dialog .jypt-timeinputs").addClass("jypt-timeinputs-active");
				}
			}
			
			$(".contentone .active").removeClass("active");
			$("#searchlist").contents().find(".contentone .btn.active").each(function(){
				var thisText = $(this).text();
				$(".contentone").find(".btn").each(function(){
					if($(this).text() == thisText){
						$(this).addClass("active");
						if($(this).parent("li").find(".btn").length == $(this).parent("li").find(".btn.active").length){
							$(this).prevAll('div[id="dqbtn"]').addClass("active");
						}
						return false;
					}
				});
			});
			
			$(".contenttwo .active").removeClass("active");
			$("#searchlist").contents().find(".contenttwo .btn.active").each(function(){
				var thisText = $(this).text();
				$(".contenttwo").find(".btn").each(function(){
					if($(this).text() == thisText){
						$(this).addClass("active");
						if($(this).parent("li").find(".btn").length == $(this).parent("li").find(".btn.active").length){
							$(this).prevAll('div[id="dqbtn"]').addClass("active");
						};
						return false;
					}
				});
			});
			
			$(".contentthree .active").removeClass("active");
			$("#searchlist").contents().find(".contentthree .btn.active").each(function(){
				var thisText = $(this).text();
				$(".contentthree").find(".btn").each(function(){
					if($(this).text() == thisText){
						$(this).addClass("active");
						if($(this).parent("li").find(".btn").length == $(this).parent("li").find(".btn.active").length){
							$(this).prevAll('div[id="dqbtn"]').addClass("active");
						};
						return false;
					}
				});
			});
			
			$(".jyshaxuan li:eq("+$("#searchlist").contents().find(".jyshaxuan li.shaixcl").index()+")").click();
		});
		qchuimg();
		function qchuimg(){
			var snqc = $(".searchname").val();
			if (snqc.length > 0){
				$(".qc").removeClass("hidden");
			}else{
				$(".qc").addClass("hidden");
			}
		}
		$(".searchname").on("input propertychange",function(){
	    	qchuimg();
	  	});
		var mykeysHtml = "";
		for(var i=0;i<msgset.length;i++){
			mykeysHtml += "<li>"+msgset[i].replace(/\+/g," ")+"</li>";
		}
		$("#mykeys").html(mykeysHtml);
		$(".qcimg").click(function(){
			$(".searchname").val("");
			$(".searchzhao3 span").html("");
			$(".searchzhong3 span").html("");
		});
		$(".search-block li").click(function(m,e){
			try{
				var searchnameVal = $(m.currentTarget).text();
				$(".searchname").val(searchnameVal);
				processVal(searchnameVal);
				beforeSubmit();
			}catch(e){
				console.info(e);
			}
		});
		$(".tubiao").click(function(){
			var sn = $(".searchname").val();
			processVal(sn);
			beforeSubmit();
		});
		$(".qc").click(function(){
			$(".searchname").val("");
			$(".qc").addClass("hidden");
			$(".wxhead").find("[name='searchname']").focus();
		});
		$(".wxhead").find(".shaixuan").click(function(){
			
			$(".point").addClass("hidden");
			$("#dingyue").addClass("hidden");
			$(".jysstj").toggleClass("hidden");
			$(".search-content").toggleClass("hidden");
			$(".s-jyshxbottom").addClass("hide");
			if(!$(".jysstj").hasClass("hidden")){
				setTimeout(function(){
					$(".s-jyshxbottom").removeClass("hide");
				},800);
			}
		});
	});
	
	function beforeSubmit(){
		var dataObj = {};
		
		this.setScope = function(){
			var scope = [];
			$(".contentone .btn.active").each(function(){
				var thisText = $(this).text();
				if(thisText == "全国"){
					scope.push("");
					return false;
				}else{
					scope.push(thisText);
				}
			});
			return scope.join(",");
		}
		
		
		var selectToptypes = "";
		$(".contenttwo #dqbtn.active").each(function(){
			var thisText = $(this).attr("data-value");
			if(selectToptypes != ""){
				selectToptypes += ",";
			}
			selectToptypes += thisText;
		});
		
		var selectSubTypes = "";
		$(".contenttwo  .btn.active").each(function(){
			if($(this).parent().index() == 0){
				return true;
			}
			var thisText = $(this).text();
			if(selectSubTypes != ""){
				selectSubTypes += ",";
			}
			selectSubTypes += thisText;
		});
		$("#searchform [name='subtype']").val(selectSubTypes);
		dataObj["scope"] = this.setScope();
		$("#searchform [name='scope']").val(dataObj["scope"]);
		$("#searchform [name='publishtime']").val(setPublishtime());
		repairTime();
		
		$(".searchform").submit();
		return true;
	}
	function processVal(value){
		$("[name='searchvalue']").val(value.replace(/^\s+|\s+$/g,"").replace(/\s+/g,"+"));
	}
	function CSubmit(){
		var sn = $(".searchname").val();
		processVal(sn);
		var dataObj = {};
		this.setScope = function(){
			var scope = [];
			$(".contentone .btn.active").each(function(){
				var thisText = $(this).text();
				if(thisText == "全国"){
					scope.push("");
					return false;
				}else{
					scope.push(thisText);
				}
			});
			return scope.join(",");
		}
		
		this.setStype = function(){
			var stype = [];
			$(".contenttwo .btn.active").each(function(){
				var thisText = $(this).text();
				if(thisText == ""){
					stype.push("");
					return false;
				}else{
					stype.push(thisText);
				}
			});
			return stype.join(",");
		}
		this.setStype = function(){
			var stype = [];
			$(".contentthree .btn.active").each(function(){
				var thisText = $(this).text();
				if(thisText == ""){
					stype.push("");
					return false;
				}else{
					stype.push(thisText);
				}
			});
			return stype.join(",");
		}
		dataObj["scope"] = this.setScope();
		dataObj["stype"] = this.setStype();
		dataObj["subfl"] = this.setStype();
		$("#searchform [name='stype']").val(dataObj["stype"]);
		$("#searchform [name='scope']").val(dataObj["scope"]);
		$("#searchform [name='subfl']").val(dataObj["subfl"]);
		$("#searchform [name='publishtime']").val(setPublishtime());
		repairTime();
		return true;
	}
	document.onkeydown = function () {
        if (window.event && window.event.keyCode == 13) {
            window.event.returnValue = false;
			beforeSubmit();
        }
    }
	function repairTime(){
		var pbtime = $("#searchform [name='publishtime']").val();
		if(pbtime == "" || !sessionStorage){
			if(pbtime == ""){
				sessionStorage.removeItem("bidsearchType");
			}
			return;
		}
		var now = new Date();
		var newDate = null;
		if(pbtime == "lately-7"){
			newDate = new Date(now.getFullYear(),now.getMonth(),now.getDate()-7);
		}else if(pbtime == "lately-30"){
			newDate = new Date(now.getFullYear(),now.getMonth(),now.getDate()-30);
		}else if(pbtime == "thisyear"){
			newDate = new Date(now.getFullYear(),0,1);
		}else{
			sessionStorage.removeItem("bidsearchType");
			return;
		}
		sessionStorage.bidsearchType = pbtime;
		
		var starttime = newDate.getTime()+"";
		starttime = starttime.substring(0,starttime.length - 3);
		now = new Date(now.getFullYear(),now.getMonth(),now.getDate()+1);
		var endtime = now.getTime()+"";
		endtime = endtime.substring(0,endtime.length - 3);
		$("#searchform [name='publishtime']").val(starttime+"_"+endtime);
	}
	</script>
<style type="text/css">
body{
	font-size:16px !important;
	color: #000;
}
.searchname{
	background-color:#FFFFFF; 
	border:1px solid #E6E6E6;
	height:45px;
	width:87%; 
	padding:2px 85px 2px 20px;
	border-radius:20px;
	font-size:16px;
	position:relative;
	box-shadow:none;
	cursor: pointer;
	webkit-transform: translateZ(0);
	-moz-transform: translateZ(0);
	-ms-transform: translateZ(0);
	-o-transform: translateZ(0);
	transform: translateZ(0);
}
.wxhead{
	height:160px;
    padding: 45px 15px;
	background-image:url(static/sousuo/files1/jysearch.png);
	background-size:100% 100%;
}
.list li{
	padding-left:35px;
}

.resdy{
	float:left; 
	height:40px; 
	margin:5px 10px; 
	width:107px; 
	border:1px solid #fff;
	line-height:40px;
	border-radius:20px;
	color:#fff;
	padding-left:20px;
	cursor:hand;
}
.resdy img{
	width: 12px;
    margin: 2px;
}
.rests{
	height:50px;
	line-height:50px;
	padding-left:15px;
	color:#fff;
	font-size:14px;
	float:left;
    overflow: hidden;
	width:60%;
    text-align: center;
}
.resbm {
    display: table;
    position: fixed;
	z-index:2000;
    left: 0px;
    right: 0px;
    bottom: 0px;
    height: 50px;
    width: 100%;
    background-color: #37c6da;
	border:1px solid #37c6da
}
.medium{
    height: 45px;
    width: 77%;
    position: absolute;
    top: 15px;
    left: 15px;
	display: none;
}
.inputHide{
    position: absolute;
	left: -10000px;
}
</style>
</head>
<body class="wxsearch">
<div id="searchDiv" style="">
	<form class="searchform" action="/mobile/weixinuser_dq.php" id="searchform" method="post"  onSubmit="CSubmit()">
    <input type="hidden" class="form-control searchname" id="searchname" value="{$searchname}" name="searchname" maxlength="50" value="" placeholder="示例：改建项目" value="">
   <input type="hidden" name="scope" id="diqu" value="">
    <input type="hidden" name="xgdq"  value="1">
	</form>
	<div class="jysstj">
		<div class="jyshaxuan" style="border-bottom:0px">
		</div>
		<div class="jyshxbottom s-jyshxbottom ">
			<ul class="text-center">
				<li class="jydqreset">重置</li>
				<li class="jydqsure">确定</li>
			</ul>
		</div>
        <!-------------------------按照地区---------------------->
        <div class="jydq-dialog">
			<div class="dialog-content contentone">
				<ul>
					<li>
						<button class="btn active">全国</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">华北地区</div>
						<button class="btn">北京</button>
						<button class="btn">天津</button>
						<button class="btn">河北</button>
						<button class="btn">山西</button>
						<button class="btn">内蒙古</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">东北地区</div>
						<button class="btn">辽宁</button>
						<button class="btn">吉林</button>
						<button class="btn">黑龙江</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">华东地区</div>
						<button class="btn">上海</button>
						<button class="btn">江苏</button>
						<button class="btn">浙江</button>
						<button class="btn">安徽</button>
						<button class="btn">福建</button>
						<button class="btn">江西</button>
						<button class="btn">山东</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">华南地区</div>
						<button class="btn">广东</button>
						<button class="btn">广西</button>
						<button class="btn">海南</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">华中地区</div>
						<button class="btn">河南</button>
						<button class="btn">湖北</button>
						<button class="btn">湖南</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">西南地区</div>
						<button class="btn">重庆</button>
						<button class="btn">四川</button>
						<button class="btn">贵州</button>
						<button class="btn">云南</button>
						<button class="btn">西藏</button>
					</li>
					<li>
						<div id="dqbtn" style="width:81px;">西北地区</div>
						<button class="btn">陕西</button>
						<button class="btn">甘肃</button>
						<button class="btn">青海</button>
						<button class="btn">宁夏</button>
						<button class="btn">新疆</button>
					</li>
				</ul>
			</div>
		</div>
     

     
	
	</div>
    
    
</div>
<div class="point hidden">
	<img src="static/sousuo/files1/point.png" style="width: 320px;">
	<img src="static/sousuo/files1/upclose.png" class="pointclose" style="width: 84px;">
</div>
</body></html>
